console.log($(window).height());
$('body').height($(window).height())

// 表单验证
    $('#fm').validate({
      rules:{
        
        username:{
          required:true,
          maxlength:16,
          minlength:6
        },
        password:{
          required:true,
          digits:true,
          rangelength:[6,12]
        }
      },
      messages:{
        
        nickname: {
          required: '必填项！',
          maxlength: '最多为 16位数字',
          minlength: '最少为 6位数字'
        },
        password: {
          required: '必填项！',
          digits: '请填写纯数字',
          rangelength: "密码长度在6-12位之间"
        }
      },
      submitHandler:function (){
        $.ajax({
          type: 'post',
          url: 'http://114.116.99.234/user/login',
        //   data: $('#fm').serialize(),
          data: {username:$('#username').val(),password:$('#password').val()},
          cache: false,
          dataType: 'json',
          success: function (msg) {
            // alert(msg.tip)
            console.log({username:$('#username').val(),password:$('#password').val()})
            console.log(msg);
            if (msg.code == 200) {
              parent.fn()

              var index = parent.layer.getFrameIndex(window.name);
              parent.layer.close(index);
              // parent.location.reload()
             
            }

          }
        })
      }
    })

    // $('#adduser').click(function () {
      
     
    // })

